/********* GameControlPlugin.m Cordova Plugin Implementation *******/

#import <Cordova/CDV.h>

#import "VideoPrizeClawViewController.h"

@interface GameControlPlugin : CDVPlugin {
  // Member variables go here.
}

- (void)coolMethod:(CDVInvokedUrlCommand*)command;
@end

@implementation GameControlPlugin

- (void)coolMethod:(CDVInvokedUrlCommand*)command
{
    CDVPluginResult* pluginResult = nil;
    NSString* echo = [command.arguments objectAtIndex:0];
    //change by sing
    echo=[echo stringByAppendingString:@" ios success"];
    DLog(@"view controller %@",self.commandDelegate);
    
    //后续使用 运行时 组件化 //target/action
    VideoPrizeClawViewController *vpcViewController = [[VideoPrizeClawViewController alloc] init];
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vpcViewController];
    
    [self.viewController presentViewController:nav animated:YES completion:nil];
    
//    if (echo != nil && [echo length] > 0) {
//        pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:echo];
//    } else {
//        pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
//    }
//
//    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}

@end
